//
//  UIView+Shape.m
//  DrinkingCaution
//
//  Created by Mac_pan on 2018/12/12.
//  Copyright © 2018 Mac. All rights reserved.
//

#import "UIView+Shape.h"

@implementation UIView (Shape)

- (void)setShape:(CGPathRef)shape {
    if (shape == nil) {
        self.layer.mask = nil;
    }

    CAShapeLayer *maskLayer = [CAShapeLayer layer];
    maskLayer.path = shape;
    self.layer.mask = maskLayer;
}





@end
